package com.javabi.htmlbuilder.css.declaration;

import com.javabi.htmlbuilder.css.CSSBuilder;
import com.javabi.htmlbuilder.css.CSSDeclaration;
import com.javabi.htmlbuilder.css.CSSPropertyName;

/**
 * A CSS Display.
 */
public enum Display implements CSSDeclaration {

	/** The none display. */
	NONE("none"),
	/** The inline display. */
	INLINE("inline"),
	/** The block display. */
	BLOCK("block"),
	/** The list-item display. */
	LIST_ITEM("list-item"),
	/** The run-in display. */
	RUN_IN("run-in"),
	/** The compact display. */
	COMPACT("compact"),
	/** The marker display. */
	MARKER("marker"),
	/** The table display. */
	TABLE("table"),
	/** The inline-table display. */
	INLINE_TABLE("inline-table"),
	/** The table-row-group display. */
	TABLE_ROW_GROUP("table-row-group"),
	/** The table-header-group display. */
	TABLE_HEADER_GROUP("table-header-group"),
	/** The table-footer-group display. */
	TABLE_FOOTER_GROUP("table-footer-group"),
	/** The table-row display. */
	TABLE_ROW("table-row"),
	/** The table-column-group display. */
	TABLE_COLUMN_GROUP("table-column-group"),
	/** The table-column display. */
	TABLE_COLUMN("table-column"),
	/** The table-cell display. */
	TABLE_CELL("table-cell"),
	/** The table-caption display. */
	TABLE_CAPTION("table-caption");

	/** The value. */
	private final String value;

	/**
	 * Creates a new declaration.
	 * @param value the value.
	 */
	private Display(String value) {
		this.value = value;
	}

	/**
	 * Returns the value.
	 * @return the value.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Returns the property.
	 * @return the property.
	 */
	public CSSPropertyName getPropertyName() {
		return CSSPropertyName.DISPLAY;
	}

	/**
	 * Append this to the given css builder.
	 * @param css the css builder.
	 * @return the css builder.
	 */
	public CSSBuilder appendTo(CSSBuilder css) {
		return css.property(getPropertyName(), getValue());
	}

}
